/*
 * Copyright © 2017 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

@import '../../../styles/variables.scss';

$th-bg-color: #bcbcbc;
$warning-container-border-color: #cccccc;
$selected-header-bg-color: #3498db;
$border-and-selected-color: #dbdbdb;
$header-bg-color: #eeeeee;
$col_type_font_color: gray;

.dataprep-container {
  .dataprep-table {
    padding: 0;
    overflow: auto;
    height: calc(100% - 30px);
    position: relative;

    &.column-highlighted {
      overflow: hidden;
      > .table.table-bordered {
        display: none;
      }
    }

    &.empty { padding-top: 15px; }

    .button-container { margin-top: 15px; }

    .table {
      margin-bottom: 0;
      font-size: 14px;
      font-family: Helvetica, Arial, sans-serif;

      &.table-bordered { border: 0; }
      .col-type {
        margin-left: 28px;
        color: $col_type_font_color;
        font-weight: 400;
        font-size: 11px;
        &.data-type-updated {
          color: $green-02;
        }
      }
      td {
        border: 1px solid $border-and-selected-color;
      }
      tbody {
        tr {
          td {
            &:first-child {
              background: $header-bg-color;
            }
            white-space: pre;
          }
        }
      }

      th {
        color: #333333;
        background-color: $header-bg-color;
        border-bottom: 2px solid $border-and-selected-color;
        border-right: 1px solid #cccccc;
        border-top: 0;
        padding: 0;

        .quality-bar {
          display: flex;
          height: 5px;
        }
        .column-wrapper-container {
          padding: 0.5rem 0.75rem;
        }

        .column-wrapper {
          display: inline-flex;
          align-items: center;
          width: 100%;
          margin-top: 5px;

          .header-text {
            width: 100%;
            cursor: initial;
            margin-right: 5px;
            white-space: nowrap;

            span {
              margin-left: 3px;
            }
          }

          .directives-dropdown-button {
            margin-right: 8px;
          }

          .column-header-checkbox {
            width: 12px;
          }

          input {
            padding: 0;
            width: auto;
            height: 20px;
          }

          .warning-container-wrapper {
            width: 100%;
            position: relative;
            input {
              padding-left: 3px;
            }
            .warning-container {
              position: absolute;
              top: 32px;
              width: calc(100% + 62px);
              left: -10px;
              background: white;
              padding: 10px;
              border: 1px solid $warning-container-border-color;
              border-top: 0;
              padding-bottom: 0;
              .warning-title-container {
                margin-left: -10px;
                margin-right: -10px;
                margin-top: -10px;
              }
              .warning-btns-container {
                margin-left: -10px;
                margin-right: -10px;
                border-top: 1px solid $warning-container-border-color;
                margin-top: 10px;
                padding: 10px;
              }
            }
          }
          > span:first-child {
            cursor: initial;
          }

        }

        &.row-count-header {
          padding: 0;
          width: 1px;
        }

        &:first-child { border-left: 0; }
        &:last-child { border-right: 0; }

        &:hover {
          .header-text {
            background: white;
          }
        }

        &.selected {
          background-color: $border-and-selected-color;
        }
      }
    }
  }
}
